//
//  CAOrderDetailGoodsFooterView.m
//  LNH
//
//  Created by twentylx on 2018/2/23.
//  Copyright © 2018年 twentylx. All rights reserved.
//

#import "CAOrderDetailGoodsFooterView.h"

@implementation CAOrderDetailGoodsFooterView

/**
 为视图绑定 viewModel
 
 @param viewModel 要绑定的ViewModel
 @param params 额外参数
 */
- (void)bindViewModel:(id <LMViewProtocol>)viewModel withParams:(NSDictionary *)params {
    
}

/**
 初始化额外数据
 */
- (void)lm_initializeForView {
    
}

/**
 初始化视图
 */
- (void)lm_createViewForView {
    [self setNeedsUpdateConstraints];
    
    [self addSubview:self.totalLabel];
    [self addSubview:self.freightLabel];
}

#pragma mark layout
- (void)updateConstraints {
    [super updateConstraints];
    
    [_totalLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).offset(20);
        make.top.equalTo(self).offset(20);
    }];
    
    [_freightLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.totalLabel);
        make.top.equalTo(self.totalLabel.mas_bottom).offset(10);
    }];
}

#pragma mark get & set
- (UILabel *)totalLabel {
    if (!_totalLabel) {
        _totalLabel = [UILabel new];
        _totalLabel.text = @"商品价格：";
        _totalLabel.textColor = RGBCOLOR(62, 58, 57);
        _totalLabel.font = [UIFont systemFontOfSize:16];
    }
    return _totalLabel;
}

- (UILabel *)freightLabel {
    if (!_freightLabel) {
        _freightLabel = [UILabel new];
        _freightLabel.text = @"配送费：";
        _freightLabel.textColor = RGBCOLOR(62, 58, 57);
        _freightLabel.font = [UIFont systemFontOfSize:16];
    }
    return _freightLabel;
}


@end
